DISCUSSION
The
ATSUUnhighlightText function removes highlighting from a specified range of text using the highlight information in the graphics port.
Before calculating the dimensions of the highlighting region to remove,
ATSUUnhighlightText turns off any previously set line justification, rotation, width alignment, descent, and ascent values and treats the text as a single line. It then examines the text layout object to make sure that the style runs cover the entire range of text. If there are gaps between style runs,
ATSUUnhighlightText assigns the characters in the gap to the style run following the gap. If there is no style run at the beginning of the range of text,
ATSUUnhighlightText assigns these characters to the first style run it can find. If there no style run at the end of the range of text,
ATSUUnhighlightText assigns the remaining characters to the last style run it can find.
If you want to remove highlighting from a range of text that spans multiple lines, you should call
ATSUUnhighlightText for each line of text that is being unhighlighted, even if all the lines are in the same text layout object. You should adjust the
iHighlightStart parameter to reflect the beginning of each line to be unhighlighted.
You can remove highlighting across tab stops by setting the bits specified by the mask constants
kATSLineFillOutToWidth and
kATSLineImposeNoAngleForEnds, described in
Line Layout Option Mask Constants.
ATSUUnhighlightText uses the previously set line ascent and descent values to calculate the height of the highlight region to be removed. If these values have not been set for the line,
ATSUUnhighlightText uses the line ascent and descent values set for the text layout object containing the line. If these are not set, it uses the default values.